package EXER;

import java.awt.event.AdjustmentEvent;

public class VehicleTest {
    public static void main(String[] args) {
        Developer yr = new Developer("闫芮",18);

        Vehicle[] vehicles = new Vehicle[3];
        vehicles[0] = new Bicycle("捷安特","红色");
        vehicles[1] = new ElecticVehicle("雅迪","天蓝色");
        vehicles[2] = new Car("奔驰","黑色","沪081799");
        for (int i = 0; i < vehicles.length; i++) {
            yr.takingVehicle(vehicles[i]);


            //附加
            if (vehicles[i] instanceof IPower){
                ((IPower) vehicles[i]).power();
            }
        }






    }
}
